<?php
class Adm_View_Helper_FilterFamilia
	extends Zend_View_Helper_FormSelect
{

	public function filterFamilia()
	{
		$options = array();
		
		foreach ($this->view->familias as $familia){
			
		    $nombre = empty($familia->nombreInterno) ? $familia->nombre : $familia->nombreInterno;
		    
			$letra = substr($nombre, 0, 1);
			
			$options[$letra][$familia->idOpcionFamilia] = $nombre;
		}
		
		ksort( $options );
		
		foreach($options as &$option){
			asort($option);
		}
		
		$options = array_merge(array($this->view->translate("allsF")), $options);
		
		return $this->formSelect('idOpcionFamilia', $this->view->idOpcionFamilia, array('class'=>'paginatorFilter'), $options);
	}


}